import { AxiosRequestConfig, InternalAxiosRequestConfig } from 'axios'

export const errorMsg = {
  400: 'Request failed! Please try again later',
  401: 'Login invalid! Please log in again',
  403: 'The current account does not have permission to access',
  404: 'The resource you are accessing does not exist',
  405: 'Request timed out! Please try again later',
  408: 'Request timed out! Please try again later',
  500: 'Exceptional service',
  502: 'Gateway error',
  503: 'service is not available',
  504: 'Request failed',
}

export interface ResultData<T> {
  status: number
  msg: string
  data: T
}
//数据请求类型
export type Method =
  | 'get'
  | 'GET'
  | 'delete'
  | 'DELETE'
  | 'head'
  | 'HEAD'
  | 'options'
  | 'OPTIONS'
  | 'post'
  | 'POST'
  | 'put'
  | 'PUT'
  | 'patch'
  | 'PATCH'
  | 'purge'
  | 'PURGE'
  | 'link'
  | 'LINK'
  | 'unlink'
  | 'UNLINK'
export interface MyInternalAxiosRequestConfig extends InternalAxiosRequestConfig {
  repeat_request_cancel?: boolean
  url?: string
  method?: string
}

export interface MyAxiosRequestConfig extends AxiosRequestConfig {
  repeat_request_cancel?: boolean
  url?: string
  method?: string
}
